#include <stdio.h>

#define MaxSize 50
typedef int ElemType;

typedef struct{
    ElemType data[MaxSize];
    int length;
}SqList;

bool InsertElem(SqList &L,int position,ElemType element)
{
    if(position<1||position>L.length+1)
    {
        return false;
    }
    if(position==MaxSize)
    {
        return false;
    }
    for (int i = L.length; i >=position ; i--) {
        L.data[i]=L.data[i-1];
    }
    L.data[position-1]=element;
    L.length++;
    return true;
}

bool DeleteElem(SqList &L,int position)
{
    if(position<1||position>L.length)
    {
        return false;
    }
    for (int i = position; i < L.length; ++i) {
        L.data[i-1]=L.data[i];
    }
    L.length--;
    return true;
}

void PrintList(SqList L)
{
    for (int i = 0; i < L.length; ++i) {
        printf("%3d",L.data[i]);
    }
    printf("\n");
}
int main() {
    SqList L;
    L.data[0]=1;
    L.data[1]=2;
    L.data[2]=3;
    L.length=3;
    ElemType InsertVal;
    scanf("%d",&InsertVal);
    bool ret;
    ret=InsertElem(L,2,InsertVal);
    if(ret)
    {
        PrintList(L);
    }
    int DeletePos;
    scanf("%d",&DeletePos);
    ret=DeleteElem(L,DeletePos);
    if(ret)
    {
        PrintList(L);
    } else
    {
        printf("false\n");
    }
    return 0;
}
